package cn.sq;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

public class TestMain {

	public static void main(String[] args) {
		//testStack();
		testQueue();
	}
	public static void testStack(){
		Stack<String> stack=new Stack<String>();
		stack.push("1");
		stack.push("2");
		stack.push("3");
		System.out.println(stack.pop());
		System.out.println(stack.pop());
		System.out.println(stack.pop());
		//System.out.println(stack.pop());//Exception
	}
    public static void testQueue(){
    	Queue<Integer> queue=new LinkedList<Integer>();
        queue.offer(1);queue.offer(2);queue.offer(3);
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        //System.out.println(queue.poll());//null
    }
}
